package com.kawa.controller;

import com.kawa.pojo.User;
import com.kawa.remote.UserRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private UserRemote userRemote;

    @GetMapping("/getUser/{id}")
    public String getUserById(@PathVariable Long id){
        System.out.println("服务消费者调用提供者 根据ID查询用户姓名！");
        return  userRemote.getUserById(id);
    }
    @GetMapping("/addUser")
    public User add(User user){
        System.out.println("服务消费者调用提供者 添加用户！");
        return userRemote.addUser(user);
    }
}
